<div navbar ng-init="currentItem='service.cron'"></div>
<div ng-show="Auth.processing||!loaded"><div loading></div></div>

<div id="main" ng-show="!Auth.processing&&loaded" style="display:none" ng-init="checkInstalled()">
	<div class="module-header">
		<h3>Cron - 定时任务管理服务器</h3>
	</div>
	
	<div srvinstall ng-init="name='Cron';pkg='cron';expected_repolist=['base'];"></div>

	<div class="tabbable" ng-show="installed">
		<ul class="nav nav-tabs">
			<li ng-class="'active' | iftrue:activeTabName=='base'"><a href="#base" ng-click="sec('base')" data-toggle="tab">基本信息</a></li>
			<li ng-class="'active' | iftrue:activeTabName=='settings'"><a href="#settings" ng-click="tabSettings()" data-toggle="tab">服务设置</a></li>
			<li ng-class="'active' | iftrue:activeTabName=='configfile'"><a href="#configfile" ng-click="sec('configfile')" data-toggle="tab">配置文件</a></li>
			<li ng-class="'active' | iftrue:activeTabName=='update'"><a href="#update" ng-click="sec('update')" data-toggle="tab">升级</a></li>
			<li ng-class="'active' | iftrue:activeTabName=='uninstall'"><a href="#uninstall" ng-click="sec('uninstall')" data-toggle="tab">卸载</a></li>
		</ul>
		<div class="tab-content">
			<div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='base'" id="base">
				<div srvbase ng-init="name='Cron';pkg='cron';service='crond';"></div>
			</div>
			<div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='settings'" id="settings">
				<form class="form-horizontal form-horizontal-small" ng-submit="updateSetting()" onsubmit="return false">
					<div class="form-group form-inline">
						<label class="col-sm-2 control-label" for="setting_mailto">发送邮件给</label>
						<div class="col-sm-10">
							<input class="form-control" ng-model="settings.mailto" ng-disabled="processing" type="text" id="setting_mailto" placeholder="指定邮箱发送地址">
						</div>
                    </div>
                    <div class="form-group form-inline">
						<label class="col-sm-2 control-label" for="setting_home">主目录</label>
						<div class="col-sm-10">
							<input class="form-control" ng-model="settings.home" ng-disabled="true" type="text" id="setting_home" placeholder="主目录">
						</div>
					</div>
                    <div class="form-group form-inline">
						<label class="col-sm-2 control-label" for="setting_path">路径</label>
						<div class="col-sm-10">
							<input class="form-control" ng-model="settings.path" ng-disabled="true" type="text" id="setting_path" placeholder="路径">
						</div>
					</div>
                    <div class="form-group form-inline">
						<label class="col-sm-2 control-label" for="setting_shell">SHELL路径</label>
						<div class="col-sm-10">
							<input class="form-control" ng-model="settings.shell" ng-disabled="true" type="text" id="setting_shell" placeholder="SHELL路径">
						</div>
					</div>
					<div class="form-group form-inline">
						<label class="col-sm-2 control-label"></label>
						<div class="col-sm-10">
							<button type="submit" class="btn btn-default" ng-disabled="processing">保存设置</button>
						</div>
					</div>
				</form>
			</div>
			<div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='configfile'" id="configfile">
				<div srvfile ng-init="items=[{name:'主配置', path:'/etc/crontab', isfile:true}, {name:'其它配置', path:'/etc/cron.d', isdir:true}, {name:'', path:'/etc/cron.monthly', isdir:true}, {name:'', path:'/etc/cron.weekly', isdir:true}, {name:'', path:'/etc/cron.daily', isdir:true}, {name:'', path:'/etc/cron.hourly', isdir:true}, {name:'', path:'/etc/cron.deny', isfile:true}];"></div>
			</div>
			<div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='update'" id="update">
				<div srvupdate ng-init="name='Cron';pkg='cron';"></div>
			</div>
			<div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='uninstall'" id="uninstall">
				<div srvuninstall ng-init="name='Cron';pkg='cron';"></div>
			</div>
		</div>
	</div>

</div>
